<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>im</title>
    <link rel="stylesheet" type="text/css" href="//webchat.7moor.com/stylesheets/moor_style.css?0620">
    <!--[if lt IE 9]>
    <link rel="stylesheet" type="text/css" href="//webchat.7moor.com/stylesheets/iconfont_ie.css?0620">
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="//webchat.7moor.com/stylesheets/iconfont.css?0620">
    <link rel="stylesheet" type="text/css" href="//webchat.7moor.com/stylesheets/iconfont.eot?0620">
    <script type="text/javascript" src="./../javascripts/m7AllQuote.js"></script>
    <!--<script type="text/javascript" src="//webchat.7moor.com/javascripts/json2.js"></script>-->
    <!--<script src="" type="text/javascript"></script>-->
    <!--<script>window.jQuery || document.write('<script src="../javascripts/jquery.min.js"><\/script>')</script>-->
    <!--<script type="text/javascript" src="./../javascripts/jquery-migrate.js"></script>-->
    <!--<script src="./../javascripts/i18n/jquery.i18n.js"></script>-->
    <style>
        /*pinchzoom.style*/
        .pinch-zoom-container{
            position: static !important;
        }
        .pinch-zoom {
            font-size: 0;
        }
        .pinch-zoom img {
            vertical-align: middle;
        }
        .pinch-zoom:after {
            display:inline-block;
            width:0;
            height:100%;
            content:"center";
            vertical-align:middle;
            overflow:hidden;
        }
    </style>
</head>
<body>
<div class="chatcontainer pc-chat" style="display: none;">
    <div class="chat-isAcceptOther"></div>
    <div class="header grey12">
        <div class="ser-info">
            <div class="logo"><img id="logo" src=""/></div>
            <div class="ser-company" id="ser-company"></div>
            <div class="connect-info" id="connect-info"></div>
        </div>
        <div class="corner-btn">
            <i class="chat-close iconfont icon-guanbi1" id="chat-close"></i>
            <span class="chat-min iconfont icon-zuixiaohua1" id="chat-min"></span>
            <span class="chat-voice iconfont icon-yinliang" id="chat-voice"></span>
        </div>
    </div>
    <div class="qimo_warp">
        <div class="qimo_davLeft" id="davLeft"></div>
        <div class="qimo_content">
            <div class="float_dav">
                    <span class="float_icon float_icon_left">
                        <img src="../images/newWebIm/left_float_icon.png" alt="">
                    </span>
                <span class="float_icon float_icon_right">
                       <img src="../images/newWebIm/right_float_icon.png" alt="">
                    </span>
                <div class="float_dav_content">
                </div>
            </div>
            <div class="m7_content" id="wrap">
                <ul class="conversation">
                    <li class="chatGoodsmsg">
                        <div class="m7_goods" id="m7GoodInfo" style="display: none">
                            <div class="m7GoodInfo_pro">
                                <div id="m7GoodLeftDt" class="m7GoodInfoLeft">
                                    <img id="m7GoodLeft"  class="m7GoodInfoLeftImg" src="" />
                                </div>
                                <div id="m7GoodInfoRight" class="m7GoodInfoRight">
                                    <span id="m7GoodRight1" class="m7_ptit"></span>
                                    <span id="m7GoodRight2" class="m7_pinfo"></span>
                                    <span id="m7GoodRight3" class="m7_price"></span>
                                </div>
                            </div>
                            <span class="m7_send_goods" id="m7_send_goods" data-i18n="submit">发送</span>
                        </div>
                    </li>
                </ul>
                <div id="launch_evaluation">
                    <form action="" class="esc_form_easy" >
                    </form>
                </div>
                <!--<input type="button" style="display: none" id="appraise_easy" way="out"/>-->
                <!--&lt;!&ndash;评价事件的触发按钮&ndash;&gt;-->
            </div>
            <div class="association_arr">
            </div>
            <div class="footer">
                <div class="end-session-box pc-session" style="display: none">
                    <div id="continue-advisory-btn">
                        <!--<div class="todo-btn-icon"></div>-->
                        <img src="../images/continue-advisory.png" width="44px" height="44px">
                        <span data-i18n="continueChat">继续咨询</span>
                    </div>
                    <div id="wap-close-btn">
                        <!--<div class="todo-btn-icon"></div>-->
                        <img src="../images/close-icon.png" width="44px" height="44px">
                        <span data-i18n="closeChat">关闭</span>
                    </div>
                </div>
                <div class="sys-msg" style="display: none;"></div>
                <div class="face-con" id="face-con">
                    <ul></ul>
                </div>
                <div class="replace-con" id="replace-con">
                    <ul></ul>
                </div>
                <div class="msg-toolbar">
                    <div id="face-btn">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="look">表情</div>
                        <i class="iconfont icon-biaoqing font20"></i>
                    </div>
                    <div id="image-btn" style="display: none;">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="pic">图片</div>
                        <i class="iconfont icon-tupian font20"></i>
                        <input style="display: none;" accept="image/jpeg,image/jpg,image/gif,image/png,image/bmp" type="file" id="picture" name="picture">
                    </div>
                    <div id="file-btn" style="display: none;">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="file">文件</div>
                        <i class="iconfont icon-wenjianjia font20" id = "file-btn-img"></i>
                    </div>
                    <div id="video-btn" class="video-btn" style="display: none;">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="videoChat">视频聊天</div>
                        <i class="iconfont icon-shipin font20" id="video-img"></i>
                    </div>
                    <div id="question-btn">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="commonProblems">常见问题</div>
                        <i class="iconfont icon-changjianwenti font20"></i>
                    </div>
                    <div id="replace-btn" class="replace-btn" re_mode="">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="replaceCustomerService">更换客服</div>
                        <i class="iconfont icon-qiehuanzuoxi font20"></i>
                    </div>
                    <div id="appraise-btn" class="appraise-btn" re_mode="">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="appraise">评价</div>
                        <i class="iconfont icon-pingjia font20"></i>
                    </div>
                    <div id="robot-appraise-btn" class="appraise-btn" re_mode="">
                        <div class="qimo_tooltip" style="display: none;" data-i18n="appraise">评价</div>
                        <i class="iconfont icon-pingjia font20"></i>
                    </div>
                </div>
                <div class="msg-input">
                    <div class="input-box">
                <textarea id="chatbox_input" class="text grey" data-i18n="saySomething" onfocus="if(value==$.i18n('saySomething')){value=''}"
                >说点什么吧...</textarea>
                    </div>
                </div>
                <div class="msg-toolbar-footer grey12">
                    <div class="qimo_dav_scrollX" id="qimoScrollX">
                        <div class="qimo">
                            <div id="oldScrollX">
                                <ul></ul>
                            </div>
                            <div id="newScrollX"></div>
                        </div>
                    </div>
                    <div class="qimo_dav_scrollY" id="newScrollY"></div>
                    <span><input type="button" data-i18n="submit" value="发送" id="chatmsg_submit" disabled="disabled"></span>
                </div>
            </div>
        </div>
        <div class="qimo_davRight" id="davRight"></div>
    </div>
    <!-- 满意度评价展示页 -->
    <div id="imcsr" class="isClose" style="display: none;border-top: none">
        <div class="close_box">
            <h3 id="thanksAndCommentService" data-i18n="thanksAndCommentService">感谢您使用我们的服务,请为此次服务进行评价</h3>
            <form id="esc_form" class='esc_form'>
                <ol class="evaluates">
                    <li></li>
                </ol>
                <div class="esc_form_reson"></div>
                <textarea class="proposal" onfocus="if(value==$.i18n('adviceForService')){value='';style.color='#000'}" rows="4"
                          onblur="if (value ==''){value=$.i18n('adviceForService');style.color='#a7a7a7'}"></textarea>
                <div class="endsession_btn">
                    <input id="appraise" class="submit_evaluate" type="button" value="提交评价" way="in" data-i18n="submitComment">
                    <input class="chatCloseBtn submit_evaluate_cancel" type="button" value="立即结束" data-i18n="immediatelyEnd">
                </div>
                <div class="evalution_btn">
                    <input id="appraise_easy" class="submit_evaluate" type="button" value="提交评价" way="out" data-i18n="submitComment">
                </div>
                <input class="chatCancelBtn submit_evaluate_cancel" type="button" value="取消" data-i18n="cancel">
            </form>
        </div>
    </div>
    <div class="busyTips" id="videoLostConnectTips" style="display: none">
        <p data-i18n="restartVideoChat">可能由于网络原因，视频连接已断开，请您重新发起视频聊天</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="videoLostConnectConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="browserVersionTips" style="display: none">
        <p data-i18n="noSupportVideoChat">您当前浏览器不支持视频聊天，请更换最新版的谷歌或者火狐浏览器</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="browserVersionTipsConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="wechatFileTip" style="display: none">
        <p data-i18n="wechatPrompt">由于微信浏览器限制无法直接下载文件，请您长按文件链接复制到手机浏览器上进行下载。</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="wechatFileTipConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="busyTips" style="display: none">
        <p data-i18n="videoChatingAndWait">对方正在视频通话中，请您稍后再发起视频会话</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="busyConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="videoErrorTips" style="display: none">
        <p data-i18n="noFindDialogue">没有找到该会话或该会话已经不在处理中</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="videoErrorConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="threeErrorTips" style="display: none">
        <p data-i18n="threeDialogueAndWait">正在三方通话中不能发起视频请求</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="threeErrorConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="agentScreenSharingTips" style="display: none">
        <p data-i18n="screenSharingAndWait">对方正在进行屏幕分享，请稍后再试</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="agentScreenSharingTipsConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="httpTips" style="display: none;">
        <p data-i18n="noHttpsAndRestart">您当前访问的域名是http请求，请转换成https请求后再发起视频聊天</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="httpTipsConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="isRobotTips" style="display: none">
        <p data-i18n="toManualServiceAndRestart">请先转人工服务，然后再发起视频聊天</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="isRobotTipsConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="busyTips" id="videoNetErrorTips" style="display: none">
        <p data-i18n="requestFailed">请求失败，请稍后重试</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="busyConfirm" id="videoNetErrorConfirm" data-i18n="confirm">确定</a>
        </div>
    </div>
    <div class="videoInvite" style="display: none">
        <p data-i18n="invitingYouVideoChat">对方正在邀请您进行视频会话</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="videoInviteReject" id="videoInviteReject" data-i18n="refuse">拒绝</a>
            <a href="javascript:void(0);" class="videoInviteAccept" id="videoInviteAccept" data-i18n="adopt">接受</a>
        </div>
    </div>
    <div class="screenShareInvite" id="screenShareInvite" style="display: none">
        <p data-i18n="invitingYouScreenSharing">对方正在邀请您观看屏幕共享</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="videoInviteReject" id="screenShareReject" data-i18n="refuse">拒绝</a>
            <a href="javascript:void(0);" class="videoInviteAccept" id="screenShareAccept" data-i18n="adopt">接受</a>
        </div>
    </div>
    <div class="closeVideoInvite" style="display: none">
        <p data-i18n="closeAndVideoChatEnd">关闭会话后视频聊天也将挂断，确认结束吗</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="videoInviteReject" id="closeVideoInvitecancel" data-i18n="cancel">取消</a>
            <a href="javascript:void(0);" class="videoInviteAccept" id="closeVideoInviteconfirm" data-i18n="immediatelyEnd">立即结束</a>
        </div>
    </div>
    <div class="closeScreenShareTip" id="closeScreenShareTip" style="display: none">
        <p data-i18n="closeAndScreenShareEnd">关闭会话后屏幕共享也将结束，确认结束吗</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="videoInviteReject" id="closeScreenSharecancel" data-i18n="cancel">取消</a>
            <a href="javascript:void(0);" class="videoInviteAccept" id="closeScreenShareconfirm" data-i18n="immediatelyEnd">立即结束</a>
        </div>
    </div>
    <div class="judegClose" style="display: none">
        <p data-i18n="isEndDialogue">结束本次对话？</p>
        <div class="esc_talk" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="judegCloseBtn" data-i18n="immediatelyEnd">立即结束</a>
            <a href="javascript:void(0);" class="judegCancelBtn" data-i18n="cancel">取消</a>
        </div>
    </div>
    <div class="satisfactionClose" style="display: none;">
        <p data-i18n="robotSolveProblem">机器人是否解决了您的问题?</p>
        <div style="margin-bottom: 20px" class="satisfactionBox">
            <label class="satisfactionBtn satisfactionCheck satisfactionBtnCommit" onclick="satisfactionCheck()"><input type="radio" value="true" name="required" checked style="width: 0;margin: 0;display: none">
                <span class="iconfont icon-youbangzhu" style="margin-right: 5px"></span><span data-i18n="solved">已解决</span>
            </label>
            <label class="satisfactionBtn satisfactionCheck" onclick="satisfactionCheck()"><input type="radio" value="false" name="required" style="width: 0;margin: 0;display: none">
                <span class="iconfont icon-meibangzhu" style="margin-right: 5px"></span><span data-i18n="unsolved">未解决</span>
            </label>
        </div>
        <div style="margin-bottom: 20px">
            <a href="javascript:void(0)" class="satisfactionBtn satisfactionCommit satisfactionBtnCommit" style="width: 25%;margin-right: 0" data-i18n="submitComment">提交评价</a>
            <a href="javascript:void(0)" class="satisfactionBtn satisfactionBtnClose satisfactionBtnColse" style="width: 25%" data-i18n="immediatelyEnd">立即结束</a>
            <a href="javascript:void(0)" class="satisfactionBtn satisfactionChannel satisfactionBtnColse" style="width: 25%" data-i18n="cancel">取消</a>
        </div>
    </div>
    <div class="robotAppraise" style="display: none">
        <p data-i18n="robotSolveProblem">机器人是否解决了您的问题?</p>
        <div style="margin-bottom: 20px">
            <a href="javascript:void(0);" class="satisfactionBtn satisfactionBtnCommit"><span class="iconfont icon-youbangzhu" style="margin-right: 5px"></span><span data-i18n="solved">已解决</span></a>
            <a href="javascript:void(0);" class="satisfactionBtn satisfactionBtnColse"><span class="iconfont icon-meibangzhu" style="margin-right: 5px"></span><span data-i18n="unsolved">未解决</span></a>
        </div>
        <a href="javascript:void(0)" class="satisfactionBtn" data-i18n="submitComment">提交评价</a>
    </div>
    <div class="vipAssignFail" style="display: none">
        <p data-i18n="exclusiveNoOnlineAndOtherService">您的专属座席不在线，您是否需要其他座席为您服务？</p>
        <div class="" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="acceptOtherAgent" data-i18n="adopt">接受</a>
            <a href="javascript:void(0);" class="refusedOtherAgent" data-i18n="noAdopt">不接受</a>
        </div>
    </div>
    <div class="inviteAgentOffline" style="display: none">
        <p data-i18n="inviteNoOnlineAndOtherService">邀请您会话的坐席目前不在线，您是否需要其他座席为您服务？</p>
        <div class="" style="width:90%; margin:0 5%">
            <a href="javascript:void(0);" class="inviteAcceptOtherAgent" data-i18n="adopt">接受</a>
            <a href="javascript:void(0);" class="inviteRefusedOtherAgent" data-i18n="noAdopt">不接受</a>
        </div>
    </div>
    <div class="chattype" style="display: none;">
        <p data-i18n="consultType">请选择咨询类型</p>
        <ul id="mtypelist" class="clearfix">

        </ul>
    </div>

    <div id="allQuestion">
        <div class="allQuestion_top">
            <span class="title_one" data-i18n="marshalling">编组</span>
            <span class="title_two" data-i18n="commonProblems">常见问题</span>
        </div>
        <div class="allQuestion_bot">
            <div class="question_groups">
                <ul>
                </ul>
            </div>
            <div class="question_common">
                <input class="quest_con_id" type="hidden" name=""/>
                <ul class="question_lis">
                </ul>
            </div>
        </div>
    </div>

    <audio src="../stylesheets/warning.mp3" style="display: none;" id="warning-tone">
    </audio>
</div>
<div class="leave-msg-box" style="display: none;">
    <div class="header grey12">
        <div class="corner-btn">
            <span class="chat-close iconfont icon-guanbi1" isleavePage="true"></span>
            <span class="chat-min iconfont icon-zuixiaohua1" ></span>
        </div>
    </div>
    <div class="qimo_warp">
        <div class="qimo_davLeft" id="davLeftLevMsg"></div>
        <div id="leaveContaner">
            <div class="leave_body">
                <p class="leave_body_p" id="leavemsg_title" data-i18n="messagesAndContactYou">请留言，我们将尽快联系您!</p>
                <form name="leaveMsgForm">
                    <div class="row_item_input textbox">
                        <textarea class="grey" id="leavemsg_content" style="width:100%; height:60px;" name="leavemsg_content" data-i18n="leaveMsg">请留言～</textarea>
                    </div>
                    <!--<div class="row_item ptext">-->
                    <!--<p data-i18n="leaveContactWay">请务必留下您的联系方式，方便我们联系您！</p>-->
                    <!--</div>-->
                    <div class="row_item_input old_leave_msg leave_msg">
                        <div class="input_label" data-i18n="phoneTitle"><i class="isEnable">*</i>联系电话:</div>
                        <div class="inputbox">
                            <input class="grey" id="leavemsg_phone" type="text"  name="leavemsg_phone" style="margin: 0;padding: 0;"/>
                        </div>
                    </div>
                    <div class="row_item_input old_leave_msg leave_msg">
                        <div class="input_label" data-i18n="eMailTitle"><i class="isEnable">*</i>邮箱:</div>
                        <div class="inputbox">
                            <input class="grey" id="leavemsg_email" type="text" name="leavemsg_email" style="margin: 0;padding: 0;"/>
                        </div>
                    </div>
                    <div id="leaveMsgBox"></div>
                    <div class="row_item_input">
                        <input type="button" data-i18n="leaveNote" value="留言" class="leave_btn" style="padding-top:0px;font-size:16px;"/>
                    </div>
                </form>
            </div>
            <div class="leave_footer">
                <div class="tips" style="display: none;">
                </div>
            </div>
        </div>
        <div class="qimo_davRight" id="davRightLevMsg"></div>
        <audio id="qimo_audio" src="" style="display: none;"></audio>
    </div>
</div>
<div id="imgview">
    <b class="closeimg" id="closeimg"></b>
    <span class="pinch-zoom"></span>
</div>
<script type="text/javascript">
    //    if(window.FormData){
    $("#image-btn").show();
    $("#file-btn").show();
    //    }

    String.prototype.trim = function () {
        var value = "";
        return "undefined" == typeof this ? "" : (value = this.replace(/^\s*/g, ""), value.replace(/\s*$/g, ""));
    };

    function loadSocketJs(url, callback) {
        var HEAD = document.getElementsByTagName("head").item(0) || document.documentElement;
        var script = document.createElement("script");
        script.setAttribute("type", "text/javascript");
        script.onload = script.onreadystatechange = function () { //Attach handlers for all browsers
            if (!/*@cc_on!@*/0 || this.readyState == "loaded" || this.readyState == "complete") {
                this.onload = this.onreadystatechange = null;
                this.parentNode.removeChild(this);
                if (typeof(callback) == "function") callback();
            }
        };
        script.setAttribute("src", url);
        HEAD.appendChild(script);
    }

    function parseQuerystring(str) {
        var href = window.location.href;
        if (str) {
            href = str
        }
        var queryStr = href.substr(href.indexOf("?") + 1);
        if ("string" != typeof queryStr)return {};
        var queryStr = queryStr.trim();
        if ("" === queryStr)return {};

        var json = {};
        try {
            for (var pairs = queryStr.split("&"), i = 0; i < pairs.length; i++) {
                var kv = pairs[i].split("=");
                kv[0] && kv[1] && (json[kv[0]] = decodeURIComponent(kv[1]))
            }
        } catch (e) {

        }
        return json;
    }

    function initChatStyle(styleColor, newwin) {
        if (styleColor && styleColor != undefined && styleColor != "undefined") {
            $(".header").css("background-color", "#" + styleColor);
            $(".msg-toolbar-footer input").css("background-color", "#" + styleColor);
            // $(".clearfix").css("background-color", "#" + styleColor);

            $('head').append("<style>.judegCloseBtn,.customer,.submit_evaluate,.evaluation_easy input{background-color: #" + styleColor + ";}" +
                ".outer-right:before, .outer-right p{border-color:transparent transparent transparent #" + styleColor + " ;}" +
                "#show-more,.sendmsg,.close_box dd a:link,.close_box dd a:hover,.close_box dd a:active,.close_box dd a:visited,"+
                ".esc_talk dd a:link,.esc_talk dd a:hover,.esc_talk dd a:active,.esc_talk dd a:visited{color:#" + styleColor + "}" +
                ".judegClose,.satisfactionClose.isClose,.robotAppraise,#mtypelist li:hover{border-color:#" + styleColor + "} .manual,.question_groups li.active{color:#" + styleColor + "}" +
                ".leave_btn{background-color:#" + styleColor + "} .reasons li.active{border-color:#" + styleColor + ";color:#" + styleColor + "} .input_icon{background-color:#" + styleColor + "}" +
                ".reply_evaluation label.active{color:#" + styleColor + "} .reply_evaluation label.active .iconfont{color:#" + styleColor + "}" +
                ".qimo_warp .end-session-box img {background-color: #"+ styleColor +"}</style>");
            $('.judegClose, .browserVersionTips ,.busyTips,.videoInvite,.closeVideoInvite, .screenShareInvite, .closeScreenShareTip, .satisfactionClose, .robotAppraise').css('borderColor', '#' + styleColor)
//          $('.esc_talk a').css('backgroundColor', '#' +styleColor)
            $('.busyConfirm, .browserVersionTipsConfirm, .videoInviteAccept, .judegCloseBtn, .acceptOtherAgent, .inviteAcceptOtherAgent').css('backgroundColor', '#' + styleColor)
            $('.judegCancelBtn, .refusedOtherAgent, .inviteRefusedOtherAgent, .videoInviteReject, .vipAssignFail').css('borderColor','#' +  styleColor)
        }

        if (serviceStates == 1) {
            $(".chatcontainer").css("display", "block");
            $(".leave-msg-box").css("display", "none");
        } else {
//            chatUtils.loadLeavemsgFields() // 加载自定义留言板
            $(".leave-msg-box").css("display", "block");
            $(".chatcontainer").css("display", "none");
        }
        if (newwin) {
            $("#chat-min").remove(), $("#chat-close").remove();
            $("#chat-voice").remove();
        }
    }
    var querys = parseQuerystring();
    var accessId = querys.accessId;
    var newwin = querys.newWin;
    var serviceStates = querys.serviceStates;
    var styleColor = querys.styleColor;
    var fromUrl = querys.fromUrl;
    var referrer = querys.seoUrl;
    var urlTitle = querys.urlTitle || "";
    var clientId = querys.clientId;
    var firstHref = querys.href;         // 访客打开客户页面时进入的第一个页面
    var firstHrefData = parseQuerystring(firstHref)
    var otherParams = querys.otherParams;
    if(!clientId || clientId == "undefined"){
        clientId = "";
    }
    if(!otherParams || otherParams == "undefined"){
        otherParams = "";
    }

    var wapPage = false;
    var version = querys.v;
    var selectPeer = querys.peer;
    var seoSource = querys.seoSource;
    var seoKeywords = querys.seoKeywords;
    if (seoSource == undefined || seoSource == 'undefined') {
        seoSource = "";
    }
    if (seoKeywords == undefined || seoKeywords == 'undefined') {
        seoKeywords = "";
    }
    //    广告投放平台
    var utm_source = firstHrefData.utm_source
    if (utm_source == undefined || utm_source == 'undefined') {
        utm_source = "";
    }
    //    广告投放渠道
    var utm_medium = firstHrefData.utm_medium
    if (utm_medium == undefined || utm_medium == 'undefined') {
        utm_medium = "";
    }
    //    推广关键字
    var utm_term = firstHrefData.utm_term
    if (utm_term == undefined || utm_term == 'undefined') {
        utm_term = "";
    }
    //    推广内容
    var utm_content = firstHrefData.utm_content
    if (utm_content == undefined || utm_content == 'undefined') {
        utm_content = "";
    }
    //    对应关键词
    var utm_campaign = firstHrefData.utm_campaign
    if (utm_campaign == undefined || utm_campaign == 'undefined') {
        utm_campaign = "";
    }
    var peers = undefined;
    if(querys.peers){
        peers = JSON.parse(querys.peers);
    }
    var msg_config = {
        chatCK: "QIMO_CHAT_SID_",
        chatMsgUrl: "http://115.29.10.194:4999",
        proxyMsgUrl: "//webchat.7moor.com",
        accessId: accessId,
        socketUrl: "//websocket.7moor.com",
        ubasocketUrl: "//user-analysis.7moor.com/ubasocket",
        clackApiUrl: "//clack.7moor.com/api",
//        clackApiUrl: "//115.29.10.194:4343/api/",
        seoSource: seoSource,
        seoKeywords: seoKeywords,
        utm_source:utm_source,
        utm_medium:utm_medium,
        utm_term: utm_term,
        utm_content:utm_content,
        utm_campaign:utm_campaign
    };

    var isIE = function(ver){
        var b = document.createElement('b')
        b.innerHTML = '<!--[if IE ' + ver + ']><i></i><![endif]-->'
        return b.getElementsByTagName('i').length === 1
    }

    //样式初始化
    initChatStyle(styleColor, newwin);

    //解决加载完后才弹出点击咨询的按钮来
    loadSocketJs(msg_config.proxyMsgUrl + "/javascripts/socket.io.js", function () {
        var script = document.createElement("script");
        script.setAttribute("type", "text/javascript");
        script.onload = script.onreadystatechange = function () { //Attach handlers for all browsers
            if (!/*@cc_on!@*/0 || this.readyState == "loaded" || this.readyState == "complete") {
                this.onload = this.onreadystatechange = null;
                this.parentNode.removeChild(this);
                // i18n
                var locale = chatUtils.parseQuerystring().language ? (chatUtils.parseQuerystring().language.toLowerCase() === 'en' ? 'en' : 'zh-CN') : 'zh-CN'
                var version = '0111'
                var zhCN = {
                    "@metadata": {
                        "locale": "zh-CN"
                    },
                    "newTabOpened":"您已打开新的窗口，刷新或点击“继续咨询”按钮继续会话",
                    "notEmpty": "发送内容不能为空",
                    "hasApprised": "您已经评价过了",
                    "continueChat": "继续咨询",
                    "closeChat": "关闭",
                    "submit": "发送",
                    "pic": "图片",
                    "look": "表情",
                    "file": "文件",
                    "videoChat": "视频聊天",
                    "commonProblems": "常见问题",
                    "appraise": "评价",
                    "replaceCustomerService": "更换客服",
                    "saySomething": "说点什么吧...",
                    "enterKey": "快捷键:Enter",
                    "immediatelyEnd": "立即结束",
                    "cancel": "取消",
                    "endingDialogue": "即将结束本次对话",
                    "thanksAndCommentService": "感谢您使用我们的服务，请为此次服务进行评价",
                    "evaluation": "评价",
                    "adviceForService": "欢迎为我们的服务提建议",
                    "submitComment": "提交评价",
                    "restartVideoChat": "可能由于网络原因，视频连接已断开，请您重新发起视频聊天",
                    "evaluationThanks": "感谢您对本次服务做出评价，祝您生活愉快，再见!",
                    "confirm": "确定",
                    "noSupportVideoChat": "您当前浏览器不支持视频聊天，请更换最新版的谷歌或者火狐浏览器",
                    "videoChatingAndWait": "对方正在视频通话中，请您稍后再发起视频会话",
                    "noFindDialogue": "没有找到该会话或该会话已经不在处理中",
                    "threeDialogueAndWait": "正在三方通话中不能发起视频请求",
                    "screenSharingAndWait": "对方正在进行屏幕分享，请稍后再试",
                    "noHttpsAndRestart": "您当前访问的域名是http请求，请转换成https请求后再发起视频聊天",
                    "toManualServiceAndRestart": "请先转人工服务，然后再发起视频聊天",
                    "requestFailed": "请求失败，请稍后重试",
                    "invitingYouVideoChat": "对方正在邀请您进行视频会话",
                    "refuse": "拒绝",
                    "adopt": "接受",
                    "noAdopt": "不接受",
                    "invitingYouScreenSharing": "对方正在邀请您观看屏幕共享",
                    "closeAndVideoChatEnd": "关闭会话后视频聊天也将挂断，确认结束吗",
                    "closeAndScreenShareEnd": "关闭会话后屏幕共享也将结束，确认结束吗",
                    "isEndDialogue": "结束本次对话？",
                    "exclusiveNoOnlineAndOtherService": "您的专属座席不在线，您是否需要其他座席为您服务？",
                    "inviteNoOnlineAndOtherService": "邀请您会话的坐席目前不在线，您是否需要其他座席为您服务？",
                    "consultType": "请选择咨询类型",
                    "marshalling": "编组",
                    "messagesAndContactYou": "请留言，我们将尽快联系您!",
                    "leaveMsg": "请留言～",
                    "leaveContactWay": "请务必留下您的联系方式，方便我们联系您！",
                    "phoneTitle": "联系电话:",
                    "phoneNum": "联系电话～",
                    "eMailTitle": "邮箱:",
                    "eMailNum": "邮箱～",
                    "leaveNote": "留言",
                    "commit": "提交",
                    "helpful": "有帮助",
                    "helpless": "没帮助",
                    "thanksForFeedback": "非常抱歉没有解决您的问题！",
                    "thanksForEncourage": "很高兴为您解决了问题！",
                    "cancelVideoChat": "视频通话已取消",
                    "noAnswerCall": "对方未接听通话",
                    "callDuration": "通话时长",
                    "cancelScreenSharing": "屏幕分享已取消",
                    "noAnswer": "对方未接听",
                    "ScreenSharingDuration": "屏幕分享时长",
                    "connecting": "连接中...",
                    "connectFailure": "抱歉，连接认证失败",
                    "connectFailureAndContact": "非常抱歉，连接失败，如有必要请直接电话联系",
                    "distributingAndWait": "系统正在为您分配客服,请稍等...",
                    "timeoutOrNetwork": "请求超时或网络问题,",
                    "writeLeavingMsg": "请填写留言内容",
                    "requiredFields": "为必填项",
                    "leaveContactWay2": "请务必留下您的任意一个联系方式",
                    "wrongTelephone": "电话格式不正确",
                    "wrongEmail": "邮箱格式不正确",
                    "sorryAndSendFailure": "非常抱歉！系统或网络问题导致消息发送失败。",
                    "leaveMsgSuccess": "留言成功",
                    "selectSeat": "点击选择更换客服",
                    "randomSeat": "点击随机更换客服",
                    "dialogueEnd": "会话结束了",
                    "toManualService": "转人工服务",
                    "leaveMsgAndReply": "客服不在线, 请留言给我们，我们将尽快给您回复",
                    "historyMsg": "查看更多历史消息",
                    "getMsgFailure": "请求超时或网络问题,获取消息失败",
                    "loadFailure": "加载失败",
                    "openWindowAgainConsult": "非常抱歉，建议您尝试稍后重新打开会话窗口进行咨询",
                    "connectFailureAndRefresh": "非常抱歉！系统或网络问题导致接入其他坐席失败，请刷新页面重新接入",
                    "transferredService": "系统已帮您转接客服",
                    "noOnlineAndLeaveMsg": "非常抱歉！客服不在线，请留言给我们。",
                    "toServiceFailureTryAgain": "非常抱歉！系统繁忙，转人工服务失败，请稍后再试",
                    "noMore": "没有更多了",
                    "videoTimeLength": "通话时长",
                    "videoHasBeenCancel": "视频通话已取消",
                    "videoNotBeAnswer": "对方未接听通话",
                    "shareHasBeenCancel": "屏幕分享已取消",
                    "shareNotBeAnswer": "对方未接收屏幕分享",
                    "shareTimeLength": "分享时长",
                    "system": "系统",
                    "agent": "客服",
                    "nextAgent": "接下来由客服",
                    "serverYou": "$1 为您服务",
                    "systemEndSession": "【系统消息】会话已被系统终结，如有需要，欢迎再联系我们",
                    "queueTip": "您当前排在第 $1 位，请耐心等候",
                    "agentTyping": "客服正在输入...",
                    "callBusy": "对方通话被占用。请稍后联系",
                    "historyList": "——  以上是历史消息  ——",
                    "commonQuestion": "【常见问题推送】",
                    "autoBreakTip": "【系统消息】由于很久没有收到您的消息，系统已自动关闭会话。如有需要，请再联系我们。",
                    "InvestigateSuccess": "评价成功",
                    "sessionFrom": "会话来源于",
                    "uploadTooLarge": "上传文件太大，超过20M",
                    "uploadImageTooLarge": "上传文件太大，超过10M",
                    "uploadBreak": "上传中断",
                    "uploadFail": "服务异常，文件发送失败",
                    "uploadImgFail": "服务异常，图片发送失败",
                    "initUpload": "正在初始化文件上传组件，请稍等。。。",
                    "initUploadSuccess": "文件上传组件加载完成，请重新点击上传按钮",
                    "imageUploadError": "只允许上传jpg，jpeg，bmp，png，gif类型的图片",
                    "pasteImageNotSupport": "您使用的浏览器暂不支持粘贴截图功能",
                    "uploadFailTryAgain": "上传失败，可以尝试重新上传",
                    "changeAgent": "已提交您的换客服请求，请耐心等待系统反馈",
                    "agentAllBusy": "抱歉，其他客服都太忙了，请您稍后再试",
                    "errorRequest": "服务异常，请求发送失败",
                    "wechatPrompt":"由于微信浏览器限制无法直接下载文件，请您长按文件链接复制到手机浏览器上进行下载",
                    "robotSolveProblem": "机器人是否解决了您的问题？",
                    "solved": "已解决",
                    "unsolved": "未解决"
                }
                var en = {
                    "@metadata": {
                        "locale": "en"
                    },
                    "newTabOpened": "You have opened a new window, refreshed or clicked the 'Continue Advice' button to continue the session",
                    "notEmpty": "Sending messages cannot be empty",
                    "hasApprised": "You have already evaluated",
                    "continueChat": "Continue",
                    "closeChat": "Close",
                    "submit": "Send",
                    "pic": "Image",
                    "look": "Emoji",
                    "file": "File",
                    "videoChat": "Video chat",
                    "commonProblems": "FAQ",
                    "appraise": "Appraise",
                    "replaceCustomerService": "Replace agent",
                    "saySomething": "Please enter",
                    "enterKey": "Shortcuts:Enter",
                    "immediatelyEnd": "Finish",
                    "cancel": "Cancel",
                    "endingDialogue": "The chat will be finish",
                    "thanksAndCommentService": "Thank you for using our service, please rate this service",
                    "evaluation": "evaluation",
                    "adviceForService": "Welcome to make suggestions for our service",
                    "submitComment": "Commit",
                    "restartVideoChat": "Because of network reasons, the video connection has been disconnected, please relaunch the video chat",
                    "evaluationThanks": "Thank you for your evaluation of this service, I wish you a happy life, goodbye",
                    "confirm": "Confirm",
                    "noSupportVideoChat": "Your browser does not support video chat, please replace the latest version of Google or Firefox",
                    "videoChatingAndWait": "The agent is in a video call, please try again later",
                    "noFindDialogue": "The chat is not found or is not in the process",
                    "threeDialogueAndWait": "You can not start the video chat when you talk to the three party",
                    "screenSharingAndWait": "The agent is sharing his screen，please try again later",
                    "noHttpsAndRestart": "The domain name you are currently visiting is a HTTP request, please convert it into a HTTPS request and launch a video chat again",
                    "toManualServiceAndRestart": "Please turn to human service first and then launch the video chat again",
                    "requestFailed": "Request failed, please try again later",
                    "invitingYouVideoChat": "The agent is inviting you for a video chat",
                    "refuse": "Refuse",
                    "adopt": "Accept",
                    "noAdopt": "Refuse",
                    "invitingYouScreenSharing": "The agent is inviting you to watch the screen share",
                    "closeAndVideoChatEnd": "After closing the chat, the video chat will also be hung up. Do you confirm closing the chat?",
                    "closeAndScreenShareEnd": "After closing the chat, the screen share will also end. Do you confirm closing the chat?",
                    "isEndDialogue": "Finish this chat?",
                    "exclusiveNoOnlineAndOtherService": "Your special agent is not online, do you need other agents to serve you?",
                    "inviteNoOnlineAndOtherService": "The agent who invited you is not online，Do you need other agents to serve you?",
                    "consultType": "Please select the type of consultation",
                    "marshalling": "Group",
                    "messagesAndContactYou": "Please leave a message and we will contact you as soon as possible.",
                    "leaveMsg": "Please leave a message",
                    "leaveContactWay": "Please leave your contact information to make it convenient for us to contact you.",
                    "phoneTitle": "Phone:",
                    "phoneNum": "Phone",
                    "eMailTitle": "Email:",
                    "eMailNum": "Email",
                    "leaveNote": "Leave a message",
                    "commit": "Commit",
                    "helpful": "Helpful",
                    "helpless": "Unhelpful",
                    "thanksForFeedback": "Thanks for feedback, we will continue to work hard。",
                    "thanksForEncourage": "Thanks for your encouragement，we will continue to make persistent efforts！",
                    "cancelVideoChat": "Video chat has been cancelled",
                    "noAnswerCall": "The agent did not answer the call",
                    "callDuration": "Call duration",
                    "cancelScreenSharing": "Screen sharing has been canceled",
                    "noAnswer": "The agent did not answer the call",
                    "ScreenSharingDuration": "Screen sharing duration",
                    "connecting": "Connecting",
                    "connectFailure": "Sorry, connection authentication failed",
                    "connectFailureAndContact": "Sorry, the connection failed. If necessary, please call us",
                    "distributingAndWait": "The system is distributing customer service for you. Please wait a moment...",
                    "timeoutOrNetwork": "Request timeout or network problems,",
                    "writeLeavingMsg": "please fill in your message",
                    "requiredFields": "Required",
                    "leaveContactWay2": "Please make sure you have leave any contact information",
                    "wrongTelephone": "Telephone format error",
                    "wrongEmail": "Email format error",
                    "sorryAndSendFailure": "Sorry!System or network problems caused the message to fail.",
                    "leaveMsgSuccess": "Success",
                    "selectSeat": "Click to change the sea",
                    "randomSeat": "Click to randomly change agents",
                    "dialogueEnd": "The chat is over",
                    "toManualService": "Human service",
                    "leaveMsgAndReply": "Customer service is not online, please leave a message to us, we will reply to you as soon as possible",
                    "historyMsg": "View historical news",
                    "getMsgFailure": "Request timeout or network problems to get message failure",
                    "loadFailure": "Failed to load",
                    "openWindowAgainConsult": "I'm sorry to suggest you reopen the chat later",
                    "connectFailureAndRefresh": "Sorry！ System or network problems cause the transfer to other agents failed, please refresh the page to reconnect",
                    "transferredService": "The system has been transferred to you",
                    "noOnlineAndLeaveMsg": "Customer service is not online, please leave a message to us。",
                    "toServiceFailureTryAgain": "Sorry！ The system is busy and the manual service is failed. Please try again later.",
                    "noMore": "No More",
                    "videoTimeLength": "Call Duration",
                    "videoHasBeenCancel": "Video call canceled",
                    "videoNotBeAnswer": "The other party did not connect the call",
                    "shareHasBeenCancel": "Screen share canceled",
                    "shareNotBeAnswer": "The other party did not receive the screen share",
                    "shareTimeLength": "Share time",
                    "system": "System",
                    "agent": "customer service",
                    "nextAgent": "接下来由客服",
                    "serverYou": "The following will be served by “$1”",
                    "systemEndSession": "[System message] The chat has been terminated by the system, and if necessary, welcome to contact us",
                    "queueTip": "You are in the $1 position, please be patient",
                    "agentTyping": "Customer service is entering",
                    "callBusy": "The chat is occupied. Please contact later",
                    "historyList": "History",
                    "commonQuestion": "[FAQ]",
                    "autoBreakTip": "[System message] The system has closed the chat because it has not received your message for a long time. If you need , please contact us again",
                    "InvestigateSuccess": "Success",
                    "sessionFrom": "from",
                    "uploadTooLarge": "The maximum is 20M",
                    "uploadImageTooLarge": "The maximum is 10M",
                    "uploadBreak": "Upload failure",
                    "uploadFail": "System error and file send failure",
                    "uploadImgFail": "System error and image send failure",
                    "initUpload": "Please wait a moment",
                    "initUploadSuccess": "Please click the upload button again",
                    "imageUploadError": "Only allow uploads of JPG, JPEG, BMP, PNG, GIF types of pictures",
                    "pasteImageNotSupport": "Your browser does not support the pasting screenshot",
                    "uploadFailTryAgain": "Upload failure, try again please",
                    "changeAgent": "We have submitted your request, please be patient with the system feedback",
                    "agentAllBusy": "Sorry, the other service is too busy. Please try again later.",
                    "errorRequest": "System error and request send failure",
                    "wechatPrompt": "Since WeChat browser can't download files directly, please long press the file link to copy to mobile browser to download.",
                    "robotSolveProblem": "Did the robot solve your problem?",
                    "solved": "solved",
                    "unsolved": "unsolved"
                }
                if (document.all && document.querySelector && !document.addEventListener) {
                    // IE8
                    $('body').find('[data-i18n]').each(function () {
                        if ($(this)[0].tagName !== 'INPUT' && $(this)[0].type !== 'button') {
                            var key = $(this).attr('data-i18n')
                            if (key && $(this)) {
                                var value = locale === 'en' ? en[key] : zhCN[key]
                                $(this)[0].innerText = value
                            }
                        }
                    })
                    $.extend({
                        i18n: function (key, $1) {
                            var value = locale === 'en' ? en[key] : zhCN[key]
                            if (value && value.indexOf('$1') > -1) {
                                value = value.replace('$1', $1)
                            }
                            return value || ''
                        }
                    })
                } else if (isIE(5) || isIE(6) || isIE(7)) {
                    // ie 6 7
                } else {
                    $.i18n().load({
                        "zh-CN": zhCN,
                        "en": en
                    });
                    $.i18n({
                        locale: locale
                    })
                    $('body').i18n()
                    $('#leavemsg_phone').attr('value', $.i18n('phoneNum'))
                    $('#leavemsg_email').attr('value', $.i18n('eMailNum'))
                }
                $('input[type=button]').each(function () {
                    var key = $(this).attr('data-i18n')
                    if (key) {
                        $(this).attr('value', $.i18n(key))
                    }
                })
                if (locale === 'en') {
                    $('.judegClose p,.satisfactionClose p, .robotAppraise p, .videoInvite p, .closeVideoInvite p,.vipAssignFail p,.inviteAgentOffline p, .screenShareInvite p, .closeScreenShareTip p, .busyTips p, .browserVersionTips p').each(function () {
                        $(this).addClass('englishTip')
                    })
                }

                //ie6/7 window open方式启动聊天窗口
                newwin && newwin == "true" && serviceStates == 1 && (init());

                wapPage && (init());
                chatUtils.wechatInitBigImg()
                window.parent && window.parent.postMessage && (window.parent.postMessage("loadSocketJs", "*"));
            }
        };
        script.setAttribute("src", msg_config.proxyMsgUrl + "/javascripts/7moorChat.js?v="+version);
        document.body.appendChild(script);
    });

    //评价只能点击一次的事件
    //    $('.esc_form_easy label').click(function(){
    //        $('.esc_form_easy .esc_mask').show();
    //    })

</script>
</body>

</html>
